Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pylint line-too-long errors in tests #697

Merged
merged 8 commits into from
Apr 9, 2022

Conversation

alanchen-1
Copy link
Contributor

In a Nutshell

Fixes pylint line-too-long errors in the tests package.

Detailed Description

Refactors some files in the tests package to comply with pylint line-too-long errors.

Related Issues

Closes #673

Copy link
Collaborator

@marvinpfoertner marvinpfoertner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this! 👍🏻

Comment on lines 96 to 97
err_msg="""Covariance of system matrix estimate does not
match naive implementation.""",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err_msg="""Covariance of system matrix estimate does not
match naive implementation.""",
err_msg=(
"Covariance of system matrix estimate does not match naive implementation."
),

since we don't really want a line break in the error message

Comment on lines 109 to 110
err_msg="""Covariance of matrix inverse estimate does not
match naive implementation.""",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Comment on lines 102 to 103
err_msg="""Covariance of system matrix estimate does not
match naive implementation.""",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in test_matrix_based_linear_belief_update.py

Comment on lines 115 to 116
err_msg="""Covariance of matrix inverse estimate does not
match naive implementation.""",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in test_matrix_based_linear_belief_update.py

Comment on lines 141 to 142
err_msg = """Mean and kernels mismatch in normal distribution
did not raise a ValueError."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in test_matrix_based_linear_belief_update.py

Comment on lines 208 to 209
msg=f"""Sample {i} from symmetric Kronecker
distribution is not symmetric.""",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in test_matrix_based_linear_belief_update.py

@@ -80,4 +80,3 @@ commands =
# pylint benchmarks --disable="unused-argument,attribute-defined-outside-init,missing-function-docstring" --jobs=0 # not a work in progress, but final
pylint benchmarks --disable="unused-argument,attribute-defined-outside-init,no-else-return,no-self-use,consider-using-from-import,missing-module-docstring,missing-class-docstring,missing-function-docstring" --jobs=0
# pylint tests --disable="missing-function-docstring" --jobs=0 # not a work in progress, but final
pylint tests --disable="arguments-differ,redefined-outer-name,too-many-instance-attributes,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unnecessary-pass,unused-variable,unused-argument,unused-private-member,attribute-defined-outside-init,no-else-return,no-self-use,consider-using-from-import,duplicate-code,line-too-long,missing-module-docstring,missing-class-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc,redundant-returns-doc" --jobs=0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line skips running pylint on the tests entirely. Please only remove the disabled line-too-long message

@alanchen-1
Copy link
Contributor Author

Shoot, didn't notice the linebreak things. Thanks for catching that, I just fixed them to all be in the parens format.

@marvinpfoertner
Copy link
Collaborator

Shoot, didn't notice the linebreak things. Thanks for catching that, I just fixed them to all be in the parens format.

No worries :)

Copy link
Collaborator

@marvinpfoertner marvinpfoertner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks ✔️

@JonathanWenger JonathanWenger added the testing and CI Unit tests, coverage and continuous integration label Apr 8, 2022
@alanchen-1
Copy link
Contributor Author

In test_arithmetic_fallbacks.py, isort and pylint have conflicts with how they want to format the commented out operators in the import statement at the top of the file if the comment is to be placed inside of the parenthesis. I just moved the commented operators outside of the parens (I couldn't think of any reason to keep it inside?).

Copy link
Contributor

@JonathanWenger JonathanWenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@JonathanWenger JonathanWenger merged commit 25479a1 into probabilistic-numerics:main Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing and CI Unit tests, coverage and continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easy-to-fix pylint messages in tests
3 participants